<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>监听</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
<!--  watch  监听:监听一个值的变化     -->
     <input type="text" v-model="message"/>
    </div>
</body>
    <script>
        new Vue({
            el:"#app",
            data:{
                message:''
            },
            watch:{
                message(newVal,oldVal){
                    console.log(newVal,oldVal)
                }

            },
            methods:{

            }


        })
    </script>
</html>